import java.io.Serializable;
import java.util.ArrayList;

/*****************************************************************************
 * File: Event.java
 * Author:  Todd Silvia & Phil Pilosi
 * Class:   CS 441 - Spring 2011
 * Project: 2 - Distributed Booking Agent, with RMI
 * Date:    February 28th 2011
 * Description: <Insert Description Here>
 */

public class Event implements Serializable {
	private ArrayList<Reservation> reservationList;		//List of all reservations pertaining to this event
	private int eventNumber;							//Unique event number for this event
	private int eventSpace;								//Amount of total space for this event
	private String eventDescription;					//Description of the event
	private int spaceRemaining;							//Amount of remaining space to fill with reservations
	
	public Event(String theDescription, int theSpace) {
		eventDescription = theDescription;
		eventSpace = theSpace;
		spaceRemaining = theSpace;
		reservationList = new ArrayList<Reservation>();
	}
	
	/*****************************************************************************
	 * Checks if there is enough space to make this reservation, if so the reservation
	 * is added to the event and the space remaining for the event is re-calculated
	 */
	public void addReservation(Reservation theReservation) {
			reservationList.add(theReservation);
	}//END addReservation()
	
	/*****************************************************************************
	 * Sets the event number for this given Event
	 */
	public void setEventNumber(int theNumber) {
		this.eventNumber = theNumber;
	}//END setEventNumber()
	
	/*****************************************************************************
	 * Changes the space remaining for the Event
	 */
	public void setSpaceRemaining(int theNumber) {
		this.spaceRemaining = this.spaceRemaining - theNumber;
	}
	
	/*******************************Getter Methods********************************/
	public int getSpaceRemaining() {
		return this.spaceRemaining;
	}//END getSpaceRemaining
	
	public ArrayList<Reservation> getReservationList() {
		return this.reservationList;
	}//END getReservationList()
	
	public int getEventNumber() {
		return this.eventNumber;
	}//END getEventNumber()
	
	public int getEventSpace() {
		return this.eventSpace;
	}//END getEventSpace()
	
	public String getEventDescription() {
		return this.eventDescription;
	}//END getEventDescription()
	
	
}//END Event{}
